#include "Rayon.hpp"

#include "Algebre/Coord.hpp"

#include "Formes/Cylindre.hpp"

#include <iostream>

using namespace std;

int main(int argc, char* argv[])
{
  Coord p(0., 0., 0.);
  VecteurU v(0., 0., 1.);
  double r(1.), h(2.);

  Cylindre cyl(v, p, r, h);

  Coord A(5., 0., 1.);

  cout << "Point " << cyl.point() << ", axe " << cyl.axe() << endl;

  Coord inter( cyl.trouveIntersection( Rayon( A, VecteurU( -1., 0., 0. ) ) ) );


  cout << "Intersection : " << inter << ", normale : " << cyl.normale( inter )
       << endl;
  cout << "*****************************************************************************" << endl;

  Coord B(0., 0.5, 10.);

  inter = cyl.trouveIntersection( Rayon( B, VecteurU( 0., 0., -1. ) ) );

  cout << "Intersection : " << inter << ", normale : " << cyl.normale( inter )
       << endl;
  cout << "*****************************************************************************" << endl;

  Coord C(0., 1, 3.);

  inter = cyl.trouveIntersection( Rayon( C, VecteurU( 0., -1., -1. ) ) );

  cout << "Intersection : " << inter << ", normale : " << cyl.normale( inter )
       << endl;

  return 0;
}
